import request from '@/utils/request'
import formurlencoded from 'form-urlencoded'


//修改密码
export function updatePwd(data) {
  return request({
    url: '/admin/system/adminuser/editpwd/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//获取管理员列表
export function fetchAdminList(query) {
  return request({
    url: '/admin/system/adminuser/list',
    method: 'get',
    params: query
  })
}

//跳转添加管理员
export function toAddAdmin(data) {
  return request({
    url: '/admin/system/adminuser/add',
    method: 'post',
    data: formurlencoded(data)
  })
}

//跳转编辑管理员
export function toEditAdmin(data) {
  return request({
    url: '/admin/system/adminuser/edit',
    method: 'post',
    data: formurlencoded(data)
  })
}

//冻结管理员
export function freezeAdmin(data) {
  return request({
    url: '/admin/system/adminuser/freeze',
    method: 'post',
    data: formurlencoded(data)
  })
}
//删除管理员账号
export function delAdmin(data) {
  return request({
    url: '/admin/system/adminuser/del',
    method: 'post',
    data: formurlencoded(data)
  })
}
//保存管理员账号
export function saveAdmin(data) {
  return request({
    url: '/admin/system/adminuser/save',
    method: 'post',
    data: formurlencoded(data)
  })
}
//更新管理员账号
export function updateAdmin(data) {
  return request({
    url: '/admin/system/adminuser/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//获取数据字典列表
export function fetchCodeList(query) {
  return request({
    url: '/admin/system/code/list',
    method: 'get',
    params: query
  })
}
//保存数据字典
export function createCode(data) {
  return request({
    url: '/admin/system/code/create',
    method: 'post',
    data: formurlencoded(data)
  })
}
//跳转编辑数据字典
export function toEditCode(query) {
  return request({
    url: '/admin/system/code/edit',
    method: 'get',
    params: query
  })
}

//更新数据字典
export function updateCode(data) {
  return request({
    url: '/admin/system/code/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//获取角色列表
export function fetchRoleList(query) {
  return request({
    url: '/admin/system/role/list',
    method: 'get',
    params: query
  })
}

//保存角色
export function saveCode(data) {
  return request({
    url: '/admin/system/role/save',
    method: 'post',
    data: formurlencoded(data)
  })
}

//跳转编辑角色
export function toEditRole(query) {
  return request({
    url: '/admin/system/role/edit',
    method: 'get',
    params: query
  })
}

//更新角色
export function updateRole(data) {
  return request({
    url: '/admin/system/role/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//删除角色
export function delRole(data) {
  return request({
    url: '/admin/system/role/del',
    method: 'post',
    data: formurlencoded(data)
  })
}
//清除缓存
export function clearCache(data) {
  return request({
    url: '/admin/system/adminuser/doclear',
    method: 'post',
    data: formurlencoded(data)
  })
}
//跳转编辑支付宝配置
export function toEditAliPay() {
  return request({
    url: '/admin/system/adminuser/alipayconfig',
    method: 'get'
  })
}
//更新支付宝配置
export function EditAliPay(data) {
  return request({
    url: '/admin/system/adminuser/alipayconfig/update',
    method: 'post',
    data: formurlencoded(data)
  })
}
//跳转编辑微信配置
export function toEditWxPay() {
  return request({
    url: '/admin/system/adminuser/wxpayconfig',
    method: 'get'
  })
}
//更新微信配置
export function EditWxPay(data) {
  return request({
    url: '/admin/system/adminuser/wxpayconfig/update',
    method: 'post',
    data: formurlencoded(data)
  })
}
//跳转编辑快递100配置
export function toEditKuaiDi() {
  return request({
    url: '/admin/system/adminuser/kuaidiconfig',
    method: 'get'
  })
}
//更新快递100配置
export function EditKuaiDi(data) {
  return request({
    url: '/admin/system/adminuser/kuaidiconfig/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//跳转编辑Oss配置
export function toEditOss() {
  return request({
    url: '/admin/system/adminuser/ossconfig',
    method: 'get'
  })
}
//更新Oss配置
export function EditOss(data) {
  return request({
    url: '/admin/system/adminuser/ossconfig/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//跳转编辑短信配置
export function toEditSms() {
  return request({
    url: '/admin/system/adminuser/smsconfig',
    method: 'get'
  })
}
//更新短信配置
export function EditSms(data) {
  return request({
    url: '/admin/system/adminuser/smsconfig/update',
    method: 'post',
    data: formurlencoded(data)
  })
}
//获取资源列表
export function getResTree(query) {
  return request({
    url: '/admin/system/resource/list',
    method: 'get',
    params: query
  })
}

//保存资源
export function saveRes(data) {
  return request({
    url: '/admin/system/resource/save',
    method: 'post',
    data: formurlencoded(data)
  })
}
//删除资源
export function delResTree(query) {
  return request({
    url: '/admin/system/resource/del',
    method: 'get',
    params: query
  })
}

//跳转编辑资源
export function toEditRes(query) {
  return request({
    url: '/admin/system/resource/editWin',
    method: 'get',
    params: query
  })
}
//更新资源
export function updateRes(data) {
  return request({
    url: '/admin/system/resource/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//员工管理列表
export function queryEmployeeList(query) {
  return request({
    url: '/admin/system/employee/list',
    method: 'get',
    params: query
  })
}

//获取公司下拉数据
export function queryCompanyList(query) {
  return request({
    url: '/admin/system/employee/queryCompanyList',
    method: 'get',
    params: query
  })
}

//获取职级职等下拉数据
export function queryPostList(query) {
  return request({
    url: '/admin/system/employee/queryPostList',
    method: 'get',
    params: query
  })
}

//修改员工信息
export function updateEmployee(data) {
  return request({
    url: '/admin/system/employee/update',
    method: 'post',
    data: data
  })
}
